package com.ibm.interfaces;

import java.util.Collection;

import com.fasterxml.jackson.databind.node.ObjectNode;
import com.ibm.util.exception.CPSException;

public interface IPersistency {

	// for service servlet
	void putTenantStatus(String tenantid, String status) throws CPSException;

	String getTenantStatus(String tenantid) throws CPSException;

	String deleteTenantStatus(String tenantid) throws CPSException;

	// for group servelt
	void putGroupMetadata(String jsonGroupMetadata) throws CPSException;

	void putGroupMetadata(ObjectNode object) throws CPSException;

	Collection<String> getGroupMetadata(String tenantid, String groupid)
			throws CPSException;

	Collection<String> getAllGroupMetadatas() throws CPSException;

	Collection<String> deleteGroupMetadata(String tenantid, String groupid)
			throws CPSException;

	// for datasource servlet
	void putDataSource(String jsonDataSourceMetadata) throws CPSException;

	void putDataSource(ObjectNode object) throws CPSException;

	Collection<String> getDataSource(String tenantid, String dataSourceName)
			throws CPSException;

	String getDataSourceByName(String tenantid, String dataSourceName)
			throws CPSException;

	Collection<String> deleteDataSource(String tenantid, String dataSourceName)
			throws CPSException;

	// for processor servlet
	void putProcessor(String jsonProcessorMetadata) throws CPSException;

	void putProcessor(ObjectNode object) throws CPSException;

	Collection<String> getProcessors(String tenantid, String processorid,
			String processorType, String groupId) throws CPSException;

	Collection<String> deleteProcessors(String tenantid, String processorid,
			String processorType, String groupId) throws CPSException;

	Collection<String> getProcessors(ObjectNode filter) throws CPSException;
	
	Collection<String> getProcessorGroups(ObjectNode filter) throws CPSException;

	Collection<String> getTenantDataSource(String tenantid,
			String dataSourceName) throws CPSException;

	void putPublisher(String jsonMetadata) throws CPSException;

	void putPublisher(ObjectNode jsonMetadata) throws CPSException;

	Collection<String> getPublisher(String tenantid, String name) throws CPSException;

	Collection<String> deletePublisher(String tenantid, String publisherName) throws CPSException;

	Collection<String> getTenantDataSource(ObjectNode filter) throws CPSException;

	Collection<String> getPublisher(ObjectNode filter) throws CPSException;

	// for credential
	Collection<String> getCredential(ObjectNode filter) throws CPSException;
	Collection<String> deleteCredential(ObjectNode filter) throws CPSException;
	void postCredential(ObjectNode filter) throws CPSException;

}
